#include <iostream>

using namespace std;

int n, k;

int path, ret;

void dfs(int pos, int begin)
{
	if(pos == k)
	{
		if(path == n) ret++;
		return;
	}

	for(int i = begin; i < n; i++)
	{
		if(path + (k - pos) * i > n) return;

		path += i;
		dfs(pos + 1, i);//以后的位置从i开始填
		path -= i;//清空现场
	}
}

int main()
{
	cin >> n >> k;

	dfs(0, 1);

	cout << ret << endl;

	return 0;
}
